package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the MEDCINE_COMPANY database table.
 * 
 */
@Entity
@Table(name="MEDCINE_COMPANY")
@NamedQuery(name="MedcineCompany.findAll", query="SELECT m FROM MedcineCompany m")
public class MedcineCompany implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="MEDCINECOMPANY_ID")
	@SequenceGenerator(initialValue=100,allocationSize=1,name="MEDCINECOMPANY_ID_GENERATOR", sequenceName="SEQID")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="MEDCINECOMPANY_ID_GENERATOR")
	private long medcinecompanyId;

	@Column(name="MEDCINECOMPANY_NAME")
	private String medcinecompanyName;

	//bi-directional many-to-one association to MedcineDetail
	@OneToMany(mappedBy="medcineCompany")
	private List<MedcineDetail> medcineDetails;

	public MedcineCompany() {
	}

	public long getMedcinecompanyId() {
		return this.medcinecompanyId;
	}

	public void setMedcinecompanyId(long medcinecompanyId) {
		this.medcinecompanyId = medcinecompanyId;
	}

	public String getMedcinecompanyName() {
		return this.medcinecompanyName;
	}

	public void setMedcinecompanyName(String medcinecompanyName) {
		this.medcinecompanyName = medcinecompanyName;
	}

	public List<MedcineDetail> getMedcineDetails() {
		return this.medcineDetails;
	}

	public void setMedcineDetails(List<MedcineDetail> medcineDetails) {
		this.medcineDetails = medcineDetails;
	}

	public MedcineDetail addMedcineDetail(MedcineDetail medcineDetail) {
		getMedcineDetails().add(medcineDetail);
		medcineDetail.setMedcineCompany(this);

		return medcineDetail;
	}

	public MedcineDetail removeMedcineDetail(MedcineDetail medcineDetail) {
		getMedcineDetails().remove(medcineDetail);
		medcineDetail.setMedcineCompany(null);

		return medcineDetail;
	}

	public MedcineCompany(String medcinecompanyName) {
		super();
		this.medcinecompanyName = medcinecompanyName;
	}

	public MedcineCompany(long medcinecompanyId, String medcinecompanyName) {
		super();
		this.medcinecompanyId = medcinecompanyId;
		this.medcinecompanyName = medcinecompanyName;
	}

}